Python | Every Kth element in list
Sometimes, while working with Python lists, we can have a problem in which we require to extract every Kth element of list and slice out a new list from that. This type of problems are quite common as a variation of list slicing. Let’s discuss a way in which this can be done. Method : Using list slicing This task can be performed using list slicing functionality. The trick here is to use the skip functionality of list to get every Kth element of list. K, as defined can be used as skip element....
read more
Python | Arrange the files in directories according to extensions
In this article, we will learn how to arrange the files in different directories according to their extensions. When you have a lot of files with different extension than you can simply use the script for your help....
read more
Python Program to Get the Class Name of an Instance
In this article, we will see How To Get a Class Name of a class instance....
read more
Python Program for Deleting a Node in a Linked List
We have discussed Linked List Introduction and Linked List Insertion in previous posts on a singly linked list.Let us formulate the problem statement to understand the deletion process. Given a ‘key’, delete the first occurrence of this key in the linked list....
read more
Python program to find the longest word in a sentence
Given a string S consisting of lowercase English alphabets, the task is to print the longest word present in the given string in python....
read more
Python – Convert day number to date in particular year
Given day number, convert to date it refers to....
read more
Python – Create dictionary from the list
Given a list. The task is to convert it to a dictionary with the values as the list element and keys as the concatenation of the given string K and value....
read more
Python program to extract Strings between HTML Tags
Given a String and HTML tag, extract all the strings between the specified tag....
read more
Python – Convert list of dictionaries to Dictionary Value list
Given a list of dictionary, convert to dictionary with same key mapped with all values in as value list....
read more
Python – Remove Negative Elements in List
Sometimes, while working with Python lists, we can have a problem in which we need to remove all the negative elements from list. This kind of problem can have application in many domains such as school programming and web development. Let’s discuss certain ways in which this task can be performed....
read more
Python program for addition and subtraction of complex numbers
Given two complex numbers z1 and z2. The task is to add and subtract the given complex numbers.Addition of complex number: In Python, complex numbers can be added using + operator.Examples:...
read more
Python – Get Nth word in given String
Sometimes, while working with data, we can have a problem in which we need to get the Nth word of a String. This kind of problem has many application in school and day-day programming. Let’s discuss certain ways in which this problem can be solved....
read more